#!/bin/sh
#AUTHOR:kissgardener

#DESCRIPTION:
#the vpn connection script.
#the script will be in a dead loop connecting to the host,
#unless user explicitly press CTRL-C, or signal a kill cmd.

#USAGE:
#the tunnel will be bind to localhost:1999, set your browser's
#proxy to socks4 and map to localhost:1999.

#NOTE:
#once ever the ssh console stucked
#use key combination: ENTER ~(tilder) .(period)
#to close it
while [ '0' ];
do
	echo "connecting..."
	ssh -F ./config -D 1999 bar 
	echo "exit with value:"$?
	echo "wait for 5 second to reconnect, CTRL+C to exit..."
	sleep 5s
done

